package product.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import product.dao.ProductInfo;
import product.server.ProductServer;

@Slf4j
@RestController
@RequestMapping("/product")
public class ProductController {
    @Autowired
    ProductServer productServer;

    @RequestMapping("/{productId}")
    public ProductInfo getOrder(@PathVariable("productId") int productId) {
        ProductInfo o = productServer.getOrderById(productId);
        log.info("收到请求 = {}", o.getId());
        return o;
    }
}
